<?php

require_once dirname(__FILE__).'/../lib/BasesfGuardUserActions.class.php';

/**
 * sfGuardUser actions.
 *
 * @package    sfGuardPlugin
 * @subpackage sfGuardUser
 * @author     Fabien Potencier
 * @version    SVN: $Id: actions.class.php 12965 2008-11-13 06:02:38Z fabien $
 */
class sfGuardUserActions extends basesfGuardUserActions
{

    protected function executeBatchDelete(sfWebRequest $request){
        if($request->getParameter('id') ==sfContext::getInstance()->getUser()->getGuardUser()->getId()){
            $this->getUser()->setFlash('error','Cannot delete the current user by yourself');
            $this->redirect('sfGuardUser/index');
        }
        parent::executeBatchDelete($request);

    }
    public function executeDelete(sfWebRequest $request){
        if($request->getParameter('id') ==sfContext::getInstance()->getUser()->getGuardUser()->getId()){
            $this->getUser()->setFlash('error','Cannot delete the current user by yourself');
            $this->redirect('sfGuardUser/index');
        }
        parent::executeDelete($request);


    }

}
